package com.beijing.cyou.model;

import lombok.Data;

@Data
public class UserOnline {

	private String name ;

	private String token ;

	private String domain ;
	
	private Long userId ;
	
	private String userName ;
	
	private String loginIp ;
	
	private boolean isInner ;

	private boolean creamFlag ;

	@Override
	public String toString() {
		return "# UserOnline [name=" + name + ", userId=" + userId + ", mailPrefix=" + userName+ ", token=" + token  + "]";
	}
	
	public UserToken changeToUserToken(){
		UserToken userToken = new UserToken();
		userToken.setUserId(this.userId);
		userToken.setUserName(this.name);
		userToken.setMailPrefix(this.userName);
		userToken.setUserEmail(this.userName + "@" + this.domain);
		userToken.setRemarks(this.userId + "##" + this.name + "@@" + this.token);
		return userToken;
	}
	
}
